include ../config.mak
#CFLAGS=-Wall -DLINUX -DOSS_SUPPORT -g -I$(SRC_PATH)/libSDL/include -I$(SRC_PATH)/libSDL
CFLAGS=$(OPTFLAGS) -Wall -DLINUX -DOSS_SUPPORT -DSDL_USE_PTHREADS -DDEBUG_ERROR -g -I$(SRC_PATH)/libSDL/include -I$(SRC_PATH)/libSDL
#CFLAGS=-Wall -DOSS_SUPPORT -DSDL_USE_PTHREADS -DDEBUG_THREADS -DDEBUG_ERROR -g -I$(SRC_PATH)/libSDL/include -I$(SRC_PATH)/libSDL
#LDLIBS = -lc -lm -lpthread
LDLIBS = -lc -lm

LIB_OBJ = SDL_audio.o SDL_audiodev.o SDL_audiomem.o SDL_dspaudio.o SDL_error.o \
		  SDL_syscond.o SDL_sysmutex.o SDL_syssem.o SDL_systhread.o SDL_systimer.o \
		  SDL_thread.o SDL_timer.o
LIB = libSDL.a
HEADER = *.h

all: $(LIB)
#all: $(PROG)
#	cp $(PROG) /tftpboot
#	cp $(PROG) /home/aaaaa

$(PROG): $(PROG_OBJS) $(LIB)
	$(CC) $(LDFLAGS) -o $@ $(PROG_OBJS) $(LIB) $(LDLIBS)

$(LIB) : $(LIB_OBJ) $(HEADER)
	$(AR) rcs $(LIB) $(LIB_OBJ)

%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $< 

clean:
	rm -rf $(LIB_OBJ) $(LIB) $(PROG_OBJS) $(PROG)

Makefile.depend depend:
	gcc -DLINUX -MM -MG -I$(SRC_PATH)/libSDL/include *.c > Makefile.depend

include Makefile.depend
